.\"
.\" Copyright (c) 2011-2019 Julien Nadeau Carriere <vedge@csoft.net>
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\" 
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
.\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
.\" (INCLUDING BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
.\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd October 16, 2011
.Dt SG_LINE 3
.Os
.ds vT Agar API Reference
.ds oS Agar 1.6
.Sh NAME
.Nm SG_Line
.Nd Agar-SG line node
.Sh SYNOPSIS
.Bd -literal
#include <agar/core.h>
#include <agar/sg.h>
.Ed
.Sh DESCRIPTION
The
.Nm
node represents a line segment or half-line in space.
This is useful in feature-based modeling, or as construction geometry.
.Sh INHERITANCE HIERARCHY
.Xr AG_Object 3 ->
.Xr SG_Node 3 ->
.Xr SG_Geom 3 ->
.Nm .
.Sh INITIALIZATION
.nr nS 1
.Ft "SG_Line *"
.Fn SG_LineNew "SG_Node *parent" "const char *name" "const M_Line3 *ln"
.Pp
.Ft "void"
.Fn SG_LineWidth "SG_Line *line" "M_Real len"
.Pp
.Ft "void"
.Fn SG_LineColor "SG_Line *line" "M_Color c"
.Pp
.Ft "void"
.Fn SG_LineStipple "SG_Line *line" "int factor" "Uint16 pattern"
.Pp
.nr nS 0
The
.Fn SG_LineNew
function creates a new point at the origin of the parent node.
If the
.Fa ln
argument is non-NULL, the line is initialized to the specified
.Xr M_Line 3
values.
.Pp
The functions
.Fn SG_LineWidth ,
.Fn SG_LineColor
and
.Fn SG_LineStipple
specify the properties used for graphically rendering the line.
.Sh STRUCTURE DATA
For the
.Nm
object:
.Pp
.Bl -tag -width "M_Vector3 n " -compact
.It Ft M_Vector3 n
Normal vector.
.It Ft M_Real len
Length of line segment.
.It Ft M_Real wd
Width in pixels for rendering.
.It Ft M_Color c
Color for rendering.
.It Ft int stFactor
Stipple factor.
.It Ft Uint16 stPat
Stipple pattern.
.El
.Sh SEE ALSO
.Xr M_Color 3 ,
.Xr M_Line 3 ,
.Xr M_Real 3 ,
.Xr M_Vector 3 ,
.Xr SG 3 ,
.Xr SG_Geom 3 ,
.Xr SG_Intro 3 ,
.Xr SG_Node 3 ,
.Xr SG_Plane 3 ,
.Xr SG_Point 3
.Sh HISTORY
The
.Nm
node class first appeared in Agar 1.6.0.
